#
# hua.shao@mediatek.com
#
# MTK Property Software.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=miniupnpd-1.6
PKG_REVISION:=7f64a95d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REVISION).tar.bz2
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_KCONFIG:=RALINK_MT7620 RALINK_MT7621 RALINK_MT7628
PKG_CONFIG_DEPENDS:=$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)))


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk

define Package/miniupnpd-1.6
  SECTION:=MTK Properties
  CATEGORY:=MTK Properties
  TITLE:=Miniupnpd Daemon
  SUBMENU:=Applications
  DEPENDS:= +libip4tc +libpthread +librt
endef

define Package/miniupnpd-1.6/description
  Miniupnpd Daemon.
endef


TARGET_CFLAGS += \
	$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),-DCONFIG_$(c)=$(CONFIG_$c)))

MAKE_FLAGS += \
	$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)=$(CONFIG_$c)))

TARGET_CFLAGS += -DCONFIG_SUPPORT_OPENWRT
MAKE_FLAGS += CONFIG_SUPPORT_OPENWRT=y
ifeq ($(CONFIG_LINUX_4_4),y)
MAKE_FLAGS += CONFIG_DEFAULTS_KERNEL_4_4=y
endif

define Package/miniupnpd-1.6/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/bin
endef


$(eval $(call BuildPackage,miniupnpd-1.6))

